// RptItemPhoneButton.cpp: implementation of the CRptItemPhoneButton class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "aremoteserver.h"
#include "RptItemPhoneButton.h"
#include <afxctl.h>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IMPLEMENT_SERIAL(CRptItemPhoneButton, CXTPReportRecordItemText, VERSIONABLE_SCHEMA | _XTP_SCHEMA_CURRENT)

CRptItemPhoneButton::CRptItemPhoneButton(LPCTSTR szText)
{
	m_Selected = FALSE;
}

CRptItemPhoneButton::~CRptItemPhoneButton()
{

}

void CRptItemPhoneButton::OnDrawCaption(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pMetrics)
{
	if(!(pDrawArgs && pMetrics))
		return;
	
	if (m_Selected)
	{
		CRect rt(pDrawArgs->rcItem.left+1,pDrawArgs->rcItem.top+1,pDrawArgs->rcItem.right-1,pDrawArgs->rcItem.bottom-1);
		CPen pen(PS_SOLID,2,RGB(51,153,255));
		pDrawArgs->pDC->SelectObject(&pen);
		pDrawArgs->pDC->SelectObject(GetStockObject(NULL_BRUSH));
		pDrawArgs->pDC->Rectangle(rt);
	}
	CXTPReportRecordItemText::OnDrawCaption(pDrawArgs, pMetrics);
}

void CRptItemPhoneButton::SetSelect(BOOL bSel)
{
	m_Selected = bSel;
}
